<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<%@ page contentType="text/html; charset=UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/style.css"/>
    <link href="<%=request.getContextPath()%>/Css/jquery-ui.min.css"
          type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery2.sorted.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/ckform.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/js/jquery-ui.min.js"></script>


    <style type="text/css">
        #addMessageDiv{
            padding-top: 100px;
            padding-left: 50px;
        }
        span{

            font-size: x-large;

        }
        tr{
            padding-top: 20px;
        }

    </style>
</head>
<body>

    <div id="addMessageDiv" >
        <form action="/" method="post" id="addMessageForm">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td><label for="msg"><span
                            style="color:#F00; margin-right:2px;">*</span>广播消息：
                    </label>
                    </td>
                    <td><textarea id="msg" name="msg" type='text' rows="3" cols="20" >${conten}</textarea></td>
                </tr>

                <tr>
                    <td><label for="frequency"><span
                            style="color:#F00; margin-right:2px;">*</span>显示频率(秒)：
                    </label>
                    </td>
                    <td><input id="frequency" name="frequency" value="${frequency}"/>
                    </td>
                </tr>
                <tr>
                    <td> <button type="button" class="btn btn-primary" onclick="confirmSetting();">确认</button></td>
                    <td> <button type="button" class="btn btn-primary" onclick="stopMsg();">停止</button></td>
                </tr>
            </table>
        </form>
    </div>

</body>
<script type="text/javascript">

  function confirmSetting(){

      var msg=$("#msg").val();
      var frequency=$("#frequency").val();

      if(msg==null||msg==''){
          alert("公告内容能为空！！");
          return ;
      }

      if(frequency==null||frequency==''){
          alert("发送频率不能为空！！");
          return ;
      }

      var myform = document.getElementById("addMessageForm");
      myform.action = "<%=request.getContextPath()%>/message/addMsg.html";
      myform.submit();
  }
  function stopMsg(){
        var myform = document.getElementById("addMessageForm");
        myform.action = "<%=request.getContextPath()%>/message/stopMsg.html";
        myform.submit();

   }

</script>

</html>